package blackjack;

public class MyMath{
	
	private static double randList[] = {1,2,3,4,5,6,7,8,9,10,11,12,13};
	private static int dim=13;
	private static int count = 0;
	private static double offset = 0.0000000000000001;
	
	public static void set_randList(double[] _r){

		count = 0;
		dim = _r.length;
		randList = new double [dim];

		for(int i=0;i<dim;i++)
			randList[i]=((_r[i]-1)/12)+offset;
			
	}
	
	public static double random(){
		
		count = count%dim;
		return randList[count++];
	}
	
	public static double random(int _index){
		return randList[_index];
	}
		
}
